package org.grow.controller;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: xwg
 * @CreateDate: 21-8-16
 */

@RestControllerAdvice
public class ExceptionBridge {
    @ExceptionHandler(NumberFormatException.class)
    public ResponseEntity<String> ne(NumberFormatException e){
        return new ResponseEntity<String>(e.getMessage(),
                null, HttpStatus.valueOf(511));
    }
}
